unit uPopUp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, dxGDIPlusClasses, ExtCtrls, StdCtrls, cxGraphics,
  cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
  dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinCaramel, dxSkinCoffee,
  dxSkinDarkRoom, dxSkinDarkSide, dxSkinFoggy, dxSkinGlassOceans,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver,
  dxSkinPumpkin, dxSkinSeven, dxSkinSharp, dxSkinSilver, dxSkinSpringTime,
  dxSkinStardust, dxSkinSummer2008, dxSkinsDefaultPainters, dxSkinValentine,
  dxSkinXmas2008Blue, cxMaskEdit, cxButtonEdit, cxTextEdit, cxMemo, jpeg,
  Buttons, Menus, cxButtons, cxImage, cxRichEdit, dxDockPanel, dxDockControl;

type
  TfAlertaMsn = class(TForm)
    Image1: TImage;
    Image2: TImage;
    SpeedButton1: TSpeedButton;
    pTexto: TPanel;
    cxRichEdit1: TcxRichEdit;
    cxTextEdit1: TcxTextEdit;
    procedure FormCreate(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure Image1Click(Sender: TObject);
    procedure SpeedButton2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fAlertaMsn: TfAlertaMsn;


implementation

uses uPrincipal, uPrincipalTestes;

{$R *.dfm}

procedure TfAlertaMsn.FormCreate(Sender: TObject);
var
  region : hrgn;
begin
  region:= CreateRoundRectRgn(0, 0, width, height, 50, 50);
  setwindowrgn(handle, region, true);
  {
  region:= CreateRoundRectRgn(0, 0, cxRichEdit1.Width, cxRichEdit1.height, 50, 50);
  setwindowrgn(cxRichEdit1.handle, region, true);


  region:= CreateRoundRectRgn(0, 0, edit1.Width, Memo1.height, 5, 5);
  setwindowrgn(edit1.handle, region, true);

  region:= CreateRoundRectRgn(0, 0, SpeedButton1.Width, SpeedButton1.height, 50, 50);
  setwindowrgn(SpeedButton1.handle, region, true);

  region:= CreateRoundRectRgn(0, 0, SpeedButton2.Width, SpeedButton2.height, 50, 50);
  setwindowrgn(SpeedButton2.handle, region, true);

  Memo1.Width:=SpeedButton1.Left+2;                  }

 // cxButton1.Glyph.Assign(Image1.Picture.Graphic);


end;


procedure TfAlertaMsn.Image1Click(Sender: TObject);
begin
  form1.teste := form1.teste - 132;
   Close;
  FreeAndNil(fAlertaMsn);
end;

procedure TfAlertaMsn.SpeedButton1Click(Sender: TObject);
begin
form1.teste := form1.teste - 132;
   Close;
  FreeAndNil(fAlertaMsn);
end;

procedure TfAlertaMsn.SpeedButton2MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
const
   sc_DragMove = $f012;
begin
  form1.teste := form1.teste - 132;
  ReleaseCapture;
  Perform(wm_SysCommand, sc_DragMove, 0);
end;

end.
